package com.rong.structural.proxyModel.jingtaiProxy;

/**
 * 代理对象 -- 静态代理
 */
public class TeacherDaoProxy implements ITeacherDao{

    // 目标对象 通过聚合来构建
    private TeachDao teachDao;

    public TeacherDaoProxy(TeachDao teachDao) {
        this.teachDao = teachDao;
    }

    @Override
    public void teach() {
        System.out.println("开始代理");
        teachDao.teach();
        System.out.println("代理结束");
    }
}
